package com.acme.bankapp.service.email;

import java.io.*;

import com.acme.bankapp.domain.bank.*;

/**
 * Class provides email service functionality
 * @author alex
 */
@SuppressWarnings("serial")
public class EmailService implements Serializable {
	private EmailSender emailSender;
	private static final String EMAIL = "email@domain.com";
	
	/**
	 * The default constructor
	 */
	public EmailService() {
		this.emailSender = new EmailSender();
		this.emailSender.start();
	}
	
	/**
	 * @param client the client
	 */
	public void sendNotificationEmail(Client client) {
		this.emailSender.getQueue().add(new Email(client, EmailService.EMAIL));
	}
	
	/**
	 * Close email sender
	 */
	public void close() {
		this.emailSender.close();
	}
}
